<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>write</title>
</head>
<body onload="getJSValue()">
<div>
	<h2>Write Board</h2>
</div>

<script type="text/javascript">
	function checkSome() {
		var id = document.forms["personForm"]["name"].value;
		// window.alert(id);
		return true;
	}

	// 赋值
	function getJSValue() {
		// 获取解码的url
		var thisUrl = decodeURI(document.URL);
		// document.write(thisUrl);
		var getval = thisUrl.split('?')[1];
		var arr = getval.split("&");
		for (index in arr) {
			var kv = arr[index];
			var key = kv.split("=")[0];
			var svalue = kv.split("=")[1];
			// console.log(arr[index][]);
			document.getElementById(key).value = svalue;
		}
	}

</script>

<div>
	<form name = "personForm" action="getsome.php" method="get" onsubmit="return checkSome()">
	id:<input type="text" readonly name="id" id = "id">
	<br>
	姓名:<input type="text" name="name" id="name">
	<br>
	年龄:<input type="text" name="age" id="age">
	<br>
	邮箱:<input type="text" name="email" id="email">
	<br>
	<input type="submit" name="">
	</form>
</div>

</body>
</html>